/**
 * Copyright 2010 Rob Jansen
 * 
 * This file is part of braids-tor-simulator.
 * 
 * braids-tor-simulator is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * braids-tor-simulator is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with braids-tor-simulator.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * $Id: Reply.java 948 2010-10-12 03:33:57Z jansen $
 */
package main.network;

/**
 * A reply generated by a server, after receiving an entire request.
 * 
 * @author Rob Jansen
 */
public class Reply extends Message {

	/**
	 * The request that requested this reply
	 */
	Request request;

	/**
	 * Create the reply message using the application, server, priority,
	 * circuit, and size specified in the request
	 * 
	 * @param request
	 *            the request containing information for this reply
	 */
	public Reply(long time, Request request) {
		super(time, request.getApplication(), request.getServer(), request
				.getRequestedDataSize());
		this.request = request;

		// keeps same circuit and priority as request
		setCircuit(request.getCircuit());
		setPriority(request.getPriority());
	}

	/**
	 * @return the request that requested this reply
	 */
	public Request getRequest() {
		return request;
	}

}
